package com.example.demo.controller;

import com.example.demo.pojo.Book;
import com.example.demo.service.BookService;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.http.ResponseEntity;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;

/**
 * (SBook)表控制层
 *
 * @author makejava
 * @since 2023-05-20 10:12:37
 */
@RestController
@RequestMapping("book")
public class BookController {


	/**
	 * 服务对象
	 */
	@Resource
	private BookService sBookService;

	@Cacheable(cacheNames = "radarMap")
	@GetMapping("/get/radarMap")
	public HashMap<String, Long> radarMap(){
		return sBookService.radarMapList();
	}

	@GetMapping("/scatterDiagram")
	@Cacheable(cacheNames = "scatterDiagram")
	public List<List<Object>> scatterDiagram(){
		return sBookService.getScatterDiagram();
	}

}

